import { Form, Select, DatePicker, Table } from "antd"
import { Public } from "../../financial"
import ZingTable from "@/pages/login/ZingTable";
import { useState } from "react";
import { useNavigate } from 'react-router-dom'
const { RangePicker } = DatePicker;
const { Option } = Select;
const headValue=[
    {name:'名称',key:'name'},
    {name:'类别',key:'type'},
    {name:'模式',key:'module'},
    {name:'日志',key:'log'},
    {name:'地址',key:'ipaddr'},
    {name:'时间',key:'actionTime'}
]
const Journal=()=>{
    const selectMan=(value:any)=>{
        console.log(value); 
    }
    const selectTime=(value:any)=>{
        console.log(value);
    }
    let [bodyValue,setbodyValue]=useState(
        {id:1,content:[
            {name:'模板1',type:'管理员',module:'模式1',log:'新增数据1',ipaddr:'192.168.1.1',actionTime:'1694083923000'},
            {name:'模板1',type:'管理员',module:'模式1',log:'新增数据1',ipaddr:'192.168.1.1',actionTime:'1694083923000'},
            {name:'模板1',type:'管理员',module:'模式1',log:'新增数据1',ipaddr:'192.168.1.1',actionTime:'1694083923000'},
            {name:'模板1',type:'管理员',module:'模式1',log:'新增数据1',ipaddr:'192.168.1.1',actionTime:'1694083923000'},
            {name:'模板1',type:'管理员',module:'模式1',log:'新增数据1',ipaddr:'192.168.1.1',actionTime:'1694083923000'},
        ]}
        )
    const onFinish=()=>{
        console.log(1);
    }
    const navigate = useNavigate();
    const toEdit=()=>{
        navigate('/home/proof/copyProof')
    } 
    const toPrevious=(page:any)=>{
        console.log(page);  
    }
    return(
        <div>
            <Public header={"核对总账"}></Public>
            <Form
                style={{ display: 'flex' }}
                name="customized_form_controls"
                layout="inline"
                onFinish={onFinish}
            >
                <Form.Item
                    label="日期："
                    name="date"
                    style={{ marginLeft: '60px' }}
                >
                    <RangePicker style={{ width: 215 }} onChange={selectTime} />
                </Form.Item>
                <Form.Item
                    label="操作者："
                    name="subone"
                >
                    <Select
                        placeholder="选择管理者"
                        allowClear
                        style={{ width: 140 }}
                        onChange={selectMan}
                    >
                        <Option value="male">male</Option>
                        <Option value="female">female</Option>
                        <Option value="other">other</Option>
                    </Select>
                </Form.Item>
                <button style={{ width: '60px', height: '35px', border: 'none', background: '#22AB82', color: 'white' }} onClick={onFinish}>搜索</button>
            </Form>
            <div style={{paddingLeft:50,marginTop:20}}><ZingTable Tstyle={{width:1200,hbackgroundColor:'#22AB82',dlineHeight:5}} theads={headValue} tbodys={bodyValue} operation1={toEdit}></ZingTable></div>
        </div>
    )
}
export default Journal